package cn.highedu.coolsharkhub.entity;

import java.time.LocalDate;

/**
 * 商品实体类 对应数据库表product
 */
public class Product {
    private Integer id; // id
    private String title; // 商品名
    private String url; // 商品图片路径
    private Double price; // 商品销售价
    private Double oldPrice; // 商品原价
    private Integer saleCount; // 销量
    private Integer num; // 库存
    private Integer categoryId; // 类别ID
    private Integer viewCount; // 浏览量
    private LocalDate created; // 创建时间
    // 默认构造 有参构造 get和set方法 toString方法

    public Product() {
    }

    public Product(Integer id, String title, String url, Double price, Double oldPrice, Integer saleCount, Integer num, Integer categoryId, Integer viewCount, LocalDate created) {
        this.id = id;
        this.title = title;
        this.url = url;
        this.price = price;
        this.oldPrice = oldPrice;
        this.saleCount = saleCount;
        this.num = num;
        this.categoryId = categoryId;
        this.viewCount = viewCount;
        this.created = created;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public Double getOldPrice() {
        return oldPrice;
    }

    public void setOldPrice(Double oldPrice) {
        this.oldPrice = oldPrice;
    }

    public Integer getSaleCount() {
        return saleCount;
    }

    public void setSaleCount(Integer saleCount) {
        this.saleCount = saleCount;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    public Integer getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Integer categoryId) {
        this.categoryId = categoryId;
    }

    public Integer getViewCount() {
        return viewCount;
    }

    public void setViewCount(Integer viewCount) {
        this.viewCount = viewCount;
    }

    public LocalDate getCreated() {
        return created;
    }

    public void setCreated(LocalDate created) {
        this.created = created;
    }

    @Override
    public String toString() {
        return "Product{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", url='" + url + '\'' +
                ", price=" + price +
                ", oldPrice=" + oldPrice +
                ", saleCount=" + saleCount +
                ", num=" + num +
                ", categoryId=" + categoryId +
                ", viewCount=" + viewCount +
                ", created=" + created +
                '}';
    }
}
